@use "../../common.scss";

.queue_item {
  @include common.roundCorners;

  display: flex;
  position: relative;
  flex-flow: row;
  flex: 0 0 auto;
  height: 4em;
  margin: 0.5em;
  margin-top: 0;
  overflow: hidden;
  background-color: rgba(common.$background2, 0.5);
  user-select: none;

  .thumbnail {
    @include common.center;

    position: relative;
    display: flex;
    width: 3em;
    min-width: 3em;
    height: 3em;
    margin: 0.5em;
    z-index: 10;

    img {
      @include common.circle;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .lock {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 100%;
      height: 100%;

      i {
        margin: 0;
      }
    }
  }

  .thumbnail_overlay {
    @include common.center;
    @include common.circle;
    @include common.transition;

    position: absolute;
    display: flex;
    width: 100%;
    height: 100%;
    background: common.$black;
    color: common.$white;
    opacity: 0;
    cursor: pointer;

    &:hover {
      opacity: 0.85;
    }

    .icon {
      display: inline-flex;
      justify-content: center;
      align-items: center;
      margin: 0;
    }
  }

  &.current_track {
    background: rgba(common.$green, 0.3);
  }

  &.error {
    background: rgba(common.$red, 0.8);
  }

  &.compact {
    width: auto;
    height: auto;
    margin: 0.25em;
    padding: 0.25em;
    margin-top: 0.5px;

    .item_info_container,
    .item_duration_container {
      display: none;
    }

    .thumbnail {
      margin: 0;
      height: auto;
      width: 100%;
      min-width: auto;
      aspect-ratio: 1 / 1;
    }

    .thumbnail_overlay {
      height: 100%;
      width: 100%;
    }

    .compact_loader {
      width: 100%;
      height: 100%;

      span {
        border-width: 4px;
      }
    }
  }

  .error_overlay {
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    font-size: 12px;
    pointer-events: none;
    margin: 0.5em;
    overflow: hidden;

    .error_icon {
      font-size: 2em;
      color: rgba(common.$white, 0.75);
    }

    .error_message {
      width: 100%;
    }
  }

  .retry_overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0.5em;
    color: rgba(common.$white, 0.75);
    font-size: 12px;
    background: rgba(common.$yellow, 0.8);
    border-radius: 4px;
    padding: 0.5em;
  }
}

.item_info_container {
  @include common.ellipsis;

  display: flex;
  margin: 0.25em;
  flex: 1 1 auto;
  flex-flow: column;
  justify-content: center;

  .name_container {
    @include common.ellipsis;
    margin-bottom: 0.25 em;
  }

  .artist_container {
    @include common.ellipsis;
    color: rgba(common.$white, 0.5);
  }
}

.item_duration_container {
  display: flex;
  overflow: hidden;
  flex: 0 0 auto;
  flex-flow: column;
  justify-content: center;

  margin: 0 0.5em;

  .item_duration {
    color: rgba(common.$white, 0.5);
  }
}
